﻿using System;
using System.Collections.Generic;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class caomeo_NewsDetail : System.Web.UI.Page
{
    public string currentUrl = "";
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!Page.IsPostBack)
        {
            string id = Request.QueryString["id"];
            currentUrl = "http://www.caomeo.com/NewsDetail.aspx?id=" + id;
            if (!string.IsNullOrEmpty(id))
            {
                bindOtherNews("10", id);
            }


        }
    }
    private void bindOtherNews(string num, string newsId)
    {
        TinTucDAO tinTucDao = new TinTucDAO();
        tinTucDao.NewsId = newsId;
        if (tinTucDao.getById())
        {
            lblTitle.Text = tinTucDao.Title;
            lblCreateDate.Text = tinTucDao.Createdate;
            lblContent.Text = tinTucDao.Content;
            rptTinBaiDaDang.DataSource = tinTucDao.News_getOtherByNewsId(num, newsId);
            rptTinBaiDaDang.DataBind();
            //MyWebUtils.MyWebUtil.goToElement(this.Page, "spanTitle");
            lblSeoTitle.Text = tinTucDao.SeoTitle;
            lblSeoKeyword.Text = "<meta name=\"keywords\" content=\"" +tinTucDao.SeoKeyword + "\"/>";
            lblSeoDescription.Text = "<meta name=\"description\" content=\"" +tinTucDao.SeoDescription + "\"/>";
        }
        else
        {
            Response.Redirect("Default.aspx");
        }
    }

}
